#include<bits/stdc++.h>
#define ll long long
#define Max 200005
using namespace std;
ll a[Max];
ll n;
ll ans;
int main() {
	freopen("color.in", "r", stdin);
	freopen("color.out", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	sort(a, a + n);
	for (int i = 0; i < n; i++) {
		if (a[i] == a[i + 1]) {
			ans++;
		}
	}
	cout << ans - 1;
	return 0;
}
